<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/home/include/init_home.jsp" %>
<%@ page import="com.welfare.admin.service.*" %>
<%
	
	String service_id		= StringUtil.nvl(request.getParameter("service_id"));



	HashMap infos = new HashMap();
	infos.put("service_id",	service_id);

   
	ServiceDAO dao 		= new ServiceDAO();
	HashList list 		= dao.selectServiceInfo(infos);		
	HashList docuList	= dao.selectServiceDocuList(infos);

	String session_user_auth		= StringUtil.nvl(session.getAttribute("session.user_auth"));
	
	if ("".equals(session_user_auth)) {		//조회수 증가
		infos.put("ip_addr", request.getRemoteAddr());
		infos.put("referer", request.getHeader("referer"));
		infos.put("user_agent", request.getHeader("user-agent"));
		dao.insertServiceCount(infos);
	}

	
	int indexNo = 1;

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title><%= list.get("service_name", 0) %> - 서대문구 <%= HOME_NAME %></title>
	<%@ include file="/home/include/cssnjs.jsp"  %>

	<script type="text/javascript">
	
	function goFaceBookScrap() {
		var href = "http://www.facebook.com/share.php?u=" + "http://bokji.sdm.go.kr/service.jsp?service_id=<%= service_id %>" + "&t=" + "서대문구 <%= list.get("service_name", 0).replaceAll("\n", " ") %>";
	    cfOpen(href, "facebook", 600, 400);
	}
	</script>
</head>
<body>
<div id="wrap01">
    <div id="header">
        <div class="subLogo">
            <h1><img src="./images/home/sub_logo.gif" alt="서대문구 맞춤복지 검색서비스" /></h1>
        </div>    
    </div>
    <div id="subcontentsWrap">
        <div class="util">
            <a href="#n" onclick="window.print()"><img src="./images/home/print.gif" alt="인쇄하기" /></a>
            <a href="#nohref" onclick="goFaceBookScrap()"><img src="./images/home/facebook.gif" alt="페이스북" /></a>
        </div>
        <div>
            <h2 class="title02"><%= list.get("service_name", 0) %></h2>
            <ol class="viewText01">
            <%	if (!"".equals(list.get("summary", 0))) { %>
                <li>
                	<strong><%=indexNo++%>. 개요</strong>
                    <div class="desc"><%= list.getToBr("summary", 0) %></div>
                </li>
           	<%	} %>
           	<%	if (!"".equals(list.get("selection", 0))) { %>
                <li>
                	<strong><%=indexNo++%>. 선정기준</strong>
                   	<div class="desc"><%= list.getToBr("selection", 0) %></div>
                </li>
           	<%	} %>
           	<%	if (!"".equals(list.get("service_info", 0))) { %>
                <li><strong><%=indexNo++%>. 서비스내용</strong>
                    <div class="desc"><%= list.get("service_info", 0) %></div>
                </li>
           	<%	} %>
           	<%	if (!"".equals(list.get("price_info", 0))) { %>
                <li><strong><%=indexNo++%>. 금액</strong>
                    <div class="desc"><%= list.getToBr("price_info", 0) %></div>
                </li>
           	<%	} %>
           	<%	if (!"".equals(list.get("document", 0)) || docuList.size() > 0) { %>
                <li><strong><%=indexNo++%>. 구비서류</strong>
                    <div class="desc"><%= list.getToBr("document", 0) %>
			<%	for (int i = 0; i < docuList.size(); i++) { %>
			<%		if ("".equals(docuList.get("file_id",i))) { %>
						<span class="file_download"><%= docuList.get("docu_name",i) %></span><%= i<docuList.size()-1?",":"" %>
			<%		} else { %>
						<span class="file_download">
							<a href="./common/fileDownload.jsp?file_id=<%= docuList.get("file_id", i) %>&file_name=<%=docuList.getEncode("docu_name",i) %>">
							<img src="./images/common/<%= StringUtil.getFileExtIcon(docuList.get("file_ext",i)) %>"/><%= docuList.get("docu_name",i) %></a><%= i<docuList.size()-1?",":"" %>
						</span>
			<%		} %>	
			<%	} %>	
					</div>
                </li>
           	<%	} %>
           	<%	if (!"".equals(list.get("dept_name", 0))) { %>
                <li><strong><%=indexNo++%>. 담당부서</strong>
                    <div class="desc"><%= list.getToBr("dept_name", 0) %></div>
                </li>
           	<%	} %>
           	<%	if (!"".equals(list.get("dept_tel", 0))) { %>
                <li><strong><%=indexNo++%>. 문의처(담당자)</strong>
                    <div class="desc"><%= list.getToBr("dept_tel", 0) %></div>
                </li>
           	<%	} %>
            <%	if (!"".equals(list.get("address", 0))) { %>
                <li><strong><%=indexNo++%>. 약도</strong>
                    <div class="desc"><%= list.get("address", 0) %> [<a class="link" href="http://map.naver.com/?query=<%= list.get("address", 0) %>&sm=top_hty&fbm=1&ie=utf8" target="_blank" title="새창으로 열림">네이버지도</a>]</div	>
                </li>             
          	<%	} %>                                               
            </ol>
        </div>
    </div>
    <div id="subfooter">
          <div class="footerLogo01">
              <img src="./images/home/footerlogo.gif" alt="서대문구 로고" />
          </div>
          <div class="footerAddr">
              <address>서울 서대문구 연희로 248 (연희동) 서대문구청 3층 복지정책과 <br /> 대표전화 : 02-330-8744 | 이메일 : <a href="mailto:ssuney84@sdm.go.kr" >ssuney84@sdm.go.kr</a></address>
          </div>
    </div>      
</div>
</body>
</html>
